package tongcheng.com.tongcheng.utils;


import tongcheng.com.tongcheng.Fields;

import static tongcheng.com.tongcheng.base.MyApps.preferences;


/**
 * Created by Administrator on 2016/12/12.
 */

public class Setting {

    public static void clear() {
        preferences.edit().clear().commit();
    }

    /**
     * 存电话
     */
    public static void setPhone(String flag) {
        preferences.edit().putString(Fields.phone, flag).commit();
    }

    /**
     * 区电话
     */
    public static String getPhone() {
        return preferences.getString(Fields.phone, "");
    }



    /**
     * 存身份
     */
    public static void setShenfen(int flag) {
        preferences.edit().putInt(Fields.shenfen, flag).commit();
    }

    /**
     * 取身份
     */
    public static Integer getShenfen() {
        return preferences.getInt(Fields.shenfen, 0);
    }

    //存服务地区
    public static void setFuwuArea(String ss) {
        preferences.edit().putString(Fields.fuwuarea, ss).commit();
    }

    //取服务地区
    public static String getFuwuArea() {
        return preferences.getString(Fields.fuwuarea, "");
    }



    //存服务地区
    public static void setFuwuArea1(String ss) {
        preferences.edit().putString(Fields.fuwuarea1, ss).commit();
    }

    //取服务地区
    public static String getFuwuArea1() {
        return preferences.getString(Fields.fuwuarea1, "");
    }



    //存临时值
    public static void setTemp(int i) {
        preferences.edit().putInt(Fields.temp, i).commit();
    }

    //取零时值
    public static Integer getTemp() {
        return preferences.getInt(Fields.temp, -1);
    }
    //存服务类型
    public static void setFuwuLeixing(String s) {
        preferences.edit().putString(Fields.fuwuleixing, s).commit();
    }


    //取服务类型
    public static String getFuwuLeixing() {
        return preferences.getString(Fields.fuwuleixing, "");
    }




    //存服务类型
    public static void setFuwuLeixing1(String s) {
        preferences.edit().putString(Fields.fuwuleixing1, s).commit();
    }


    //取服务类型
    public static String getFuwuLeixing1() {
        return preferences.getString(Fields.fuwuleixing1, "");
    }




    //存用户id
    public static void setId(int id) {
        preferences.edit().putInt(Fields.ID, id).commit();
    }

    //取用户id
    public static Integer getId() {
        return preferences.getInt(Fields.ID, 0);
    }
    //存信用分
    public static void setXinYongFen(int credit_score) {
        preferences.edit().putInt(Fields.XINGYONG, credit_score).commit();
    }

    //取信用分
    public static Integer getXinYongFen() {
        return preferences.getInt(Fields.XINGYONG, 0);
    }


    //存地址
    public static void setAddress(String address) {
        preferences.edit().putString(Fields.ADDRESS, address).commit();
    }
    //取地址
    public static String getAddress() {
        return preferences.getString(Fields.ADDRESS, "");
    }

    //存地址详情
    public static void setAddress_detail(String address_detail) {
        preferences.edit().putString(Fields.ADDRESSDETIAL, address_detail).commit();
    }
    //取地址详情
    public static String getAddress_detail(){
        return preferences.getString(Fields.ADDRESSDETIAL, "");
    }


    //存公司规模
    public static void setGuiMo(String scale) {
        preferences.edit().putString(Fields.GUIMO, scale).commit();
    }
    //取公司规模
    public static String getGuiMo() {
        return preferences.getString(Fields.GUIMO, "");
    }


    //存头像
    public static void setTouXiang(String avatar) {
        preferences.edit().putString(Fields.TOUXIANG, avatar).commit();
    }
    //取头像
    public static String getTouXiang() {
        return preferences.getString(Fields.TOUXIANG, "");
    }


    //存用户名
    public static void setUserName(String user_name) {
        preferences.edit().putString(Fields.USERNAME, user_name).commit();
    }
    //取用户名
    public static String getUserName() {
        return preferences.getString(Fields.USERNAME, "");
    }


    //存余额
    public static void setYuE(String balance) {
        preferences.edit().putString(Fields.YUe, balance).commit();
    }
    //取余额
    public static String getYuE() {
        return preferences.getString(Fields.YUe,"0.00");
    }


    //存经度
    public static void setJinDu(double longitude) {
        preferences.edit().putString(Fields.JINDU, longitude+"").commit();
    }
    //取经度
    public static String getJinDu() {
        return preferences.getString(Fields.JINDU,"");
    }


    //存纬度
    public static void setWeiDu(double latitude) {
        preferences.edit().putString(Fields.WEIDU, latitude+"").commit();
    }
    //取纬度
    public static String getWeiDu() {
        return preferences.getString(Fields.WEIDU,"");
    }


    //存省市区
    public static void setArea(String trim) {
        preferences.edit().putString(Fields.SSQ, trim).commit();
    }
    //取省市区
    public static String getArea() {
        return preferences.getString(Fields.SSQ,"");
    }


    //存公司资历
    public static void setZiLi(String trim) {
        preferences.edit().putString(Fields.ZILI, trim).commit();
    }
    //取公司资历
    public static String getZiLi() {
        return preferences.getString(Fields.ZILI,"");
    }


    //存证书
    public static void setZhenShu(String s) {
        preferences.edit().putString(Fields.ZHYENSHU, s).commit();
    }
    //取证书
    public static String getZhenShu() {
        return preferences.getString(Fields.ZHYENSHU,"");
    }


    //存身份证号码
    public static void setShenFenNo(String trim) {
        preferences.edit().putString(Fields.SHENFENNO, trim).commit();
    }
    //取身份证号码
    public static String getShenFenNo() {
        return preferences.getString(Fields.SHENFENNO,"");
    }


    //存联系电话
    public static void setLianXiDianHua(String trim) {
        preferences.edit().putString(Fields.LIANXIDIANHUA, trim).commit();
    }
    //取联系电话
    public static String getLianXiDianHua() {
        return preferences.getString(Fields.LIANXIDIANHUA,"");
    }


    //存支付宝账户
    public static void setZhiFuBaoZhangHu(String zhifubao){
        preferences.edit().putString(Fields.ZhiFuBaoZhangHu,zhifubao).commit();
    }
    //取支付宝账户
    public static String getZhiFuBaoZhangHu(){
        return preferences.getString(Fields.ZhiFuBaoZhangHu,"");
    }

    //存支付宝姓名
    public static void setZhiFuBaoZhangHuName(String name){
        preferences.edit().putString(Fields.ZhiFuBaoZhangHuName,name).commit();
    }
    //取支付宝姓名
    public static String getZhiFuBaoZhangHuName(){
        return preferences.getString(Fields.ZhiFuBaoZhangHuName,"");
    }


    //存微信账户
    public static void setWeiXinZhangHu(String weixin){
        preferences.edit().putString(Fields.WeiXinZhangHu,weixin).commit();
    }
    //取微信账户
    public static String getWeiXinZhangHu(){
        return preferences.getString(Fields.WeiXinZhangHu,"");
    }
    //存微信姓名
    public static void setWeiXinZhangHuName(String name){
        preferences.edit().putString(Fields.WeiXinZhangHuName,name).commit();
    }
    //取微信姓名
    public static String getWeiXinZhangHuName(){
        return preferences.getString(Fields.WeiXinZhangHuName,"");
    }
}
